
import { _decorator, Component, Node, Prefab, CCInteger } from 'cc';
const { ccclass, property } = _decorator;


//对象池存的是 node 还有node的一些数据 prefab 和length 在场景中添加建筑（模型）需要的数据
export class SpawnItem {
    public spawnItemData: SpawnItemData = null!;
    public node: Node = null!;
}

//模型数据
@ccclass('SpawnItemData')
export class SpawnItemData {

    @property(CCInteger)
    node_length = 0;

    @property(Prefab)
    prefab: Prefab = null!;

}


/*规定起点生成建筑的起点  startCreatePos
// 道路的长度 roadLength
//摄像机跑过该物体多少距离进行回收
// spawnItemArray //要多少建筑prefab
*/
@ccclass('SpawnConfig')
export class SpawnConfig {
    @property(CCInteger)
    startCreatePos = 0

    @property(CCInteger)
    createLength = 0;

    @property(CCInteger)
    recoveryOffset = 0;

    @property([SpawnItemData])
    spawnItemDataArray: SpawnItemData[] = []
}


